package com.conferences.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.conferences.dao.ConferenceDAO;
import com.conferences.model.Conference;
import com.conferences.model.User;
import com.conferences.service.ConferenceService;

@Service("conferenceService")
public class ConferenceServiceImpl implements ConferenceService {

	@Autowired
	ConferenceDAO conferenceDAO;

	@Transactional(readOnly = false)
	@Override
	public void save(Conference conference) {
		conferenceDAO.save(conference);
	}
	
	@Transactional(readOnly = false)
	@Override
	public void delete(Conference conference) {
		conferenceDAO.delete(conference);
	}

	@Transactional(readOnly = true)
	@Override
	public List<Conference> list() {
		return conferenceDAO.list();
	}

	@Transactional(readOnly = true)
	@Override
	public Conference get(Long id) {
		return conferenceDAO.get(id);
	}

	@Override
	public List<Conference> list(User user) {
		return conferenceDAO.list(user);
	}
}
